package com.gym.controller;

import com.gym.client.LoseClient;
import com.gym.pojo.Lose;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class LoseController {

    @Resource
    private LoseClient loseClient;
    @RequestMapping("/select")
    public Map<String, Object> select(String losename, int page, int limit) {
        return loseClient.selectlose(losename,page,limit);
    }
    @RequestMapping("/selectlosename")
    public Lose selectlosename(String losename){
        return loseClient.selectlosename(losename);
    }
    @RequestMapping("/insert")
    public boolean insert(Lose lose){
        return loseClient.insert(lose);
    }
    @RequestMapping("/update")
    public boolean update(Lose lose){
        return loseClient.update(lose);
    }
    @RequestMapping("/delete")
    public boolean delete(int loseId){
        return loseClient.delete(loseId);
    }

}
